//
//  FirstViewController.m
//  Homework_12(1)
//
//  Created by 徐昊 on 16/7/30.
//  Copyright © 2016年 徐昊. All rights reserved.
//

#import "FirstViewController.h"

@interface FirstViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@end

@implementation FirstViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
//    self.imageView.layer.cornerRadius = self.view.frame.size.height * 3 / 16;
//    self.imageView.layer.masksToBounds = YES;
#pragma mark - 贝塞尔曲线做圆
    UIGraphicsBeginImageContextWithOptions(_imageView.bounds.size, NO, 1.0);
    [[UIBezierPath bezierPathWithRoundedRect:_imageView.bounds cornerRadius:_imageView.frame.size.width] addClip];
    [_imageView drawRect:_imageView.bounds];
    _imageView.image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
